package fr.inria.phoenix.diasuite.framework.controller.promptercontroller;

import fr.inria.diagen.core.ServiceConfiguration;
import fr.inria.diagen.core.service.composite.CompositeException;
import fr.inria.diagen.core.exception.InvocationException;
import fr.inria.diagen.core.network.RemoteServiceInfo;
import fr.inria.diagen.core.service.local.Service;
import fr.inria.diagen.core.service.proxy.Proxy;

import fr.inria.phoenix.diasuite.framework.context.cookerprofile.CookerProfileValue;
import fr.inria.phoenix.diasuite.framework.context.cookerstatus.CookerStatusValue;

/**
 * <pre>
controller PrompterController {
 * 	when provided CookerStatus do AskQuestion on Prompter;
 * 	when provided CookerProfile do AskQuestion on Prompter;
 * }
</pre>
 */
@SuppressWarnings("all")
public abstract class AbstractPrompterController extends Service {
    
    public AbstractPrompterController(ServiceConfiguration serviceConfiguration) {
        super("/Controller/PrompterController/", serviceConfiguration);
    }
    
    // Methods from the Service class
    @Override
    protected final void internalPostInitialize() {
        subscribeValue("cookerProfile", "/Context/CookerProfile/"); // subscribe to CookerProfile context
        subscribeValue("cookerStatus", "/Context/CookerStatus/"); // subscribe to CookerStatus context
        postInitialize();
    }
    
    @Override
    public final void valueReceived(java.util.Map<String, Object> properties, RemoteServiceInfo source, String eventName, Object value, Object... indexes) {
        if (eventName.equals("cookerProfile") && source.isCompatible("/Context/CookerProfile/")) {
            CookerProfileValue cookerProfileValue = new CookerProfileValue((java.lang.Boolean) value);
            
            onCookerProfile(cookerProfileValue, new DiscoverForCookerProfile());
        }
        if (eventName.equals("cookerStatus") && source.isCompatible("/Context/CookerStatus/")) {
            CookerStatusValue cookerStatusValue = new CookerStatusValue((fr.inria.phoenix.diasuite.framework.datatype.cookerstatus.CookerStatus) value);
            
            onCookerStatus(cookerStatusValue, new DiscoverForCookerStatus());
        }
    }
    // End of methods from the Service class
    
    // Interaction contract implementation
    /**
     * This method is called when the <code>CookerStatus</code> context publishes a value.
     * 
     * <pre>
     * when provided CookerStatus do AskQuestion on Prompter;
     * </pre>
     * 
     * @param cookerStatus the value of the <code>CookerStatus</code> context.
     * @param discover a discover object to get context values and action methods
     */
    protected abstract void onCookerStatus(CookerStatusValue cookerStatus, DiscoverForCookerStatus discover);
    
    /**
     * This method is called when the <code>CookerProfile</code> context publishes a value.
     * 
     * <pre>
     * when provided CookerProfile do AskQuestion on Prompter;
     * </pre>
     * 
     * @param cookerProfile the value of the <code>CookerProfile</code> context.
     * @param discover a discover object to get context values and action methods
     */
    protected abstract void onCookerProfile(CookerProfileValue cookerProfile, DiscoverForCookerProfile discover);
    
    // End of interaction contract implementation
    
    // Discover object for CookerStatus
    /**
     * An object to discover devices and contexts for the following interaction contract:
     * 
     * <code>
     * when provided CookerStatus do AskQuestion on Prompter;
     * </code>
     */
    protected final class DiscoverForCookerStatus {
        private final PrompterDiscovererForCookerStatus prompterDiscoverer = new PrompterDiscovererForCookerStatus(AbstractPrompterController.this);
        
        /**
         * @return a {@link PrompterDiscovererForCookerStatus} object to discover <code>Prompter</code> devices
         */
        public PrompterDiscovererForCookerStatus prompters() {
            return prompterDiscoverer;
        }
    }
    
    /**
     * Discover object that will exposes the <code>Prompter</code> devices to execute action on for the
     * <code>when provided CookerStatus</code> interaction contract.
    
    <pre>
    device Prompter extends PhysicalDevice {
    	action AskQuestion;
    	source answer as String indexed by questionId as String;
    }
    </pre>
     */
    protected final static class PrompterDiscovererForCookerStatus {
        private Service serviceParent;
        
        private PrompterDiscovererForCookerStatus(Service serviceParent) {
            super();
            this.serviceParent = serviceParent;
        }
        
        private PrompterCompositeForCookerStatus instantiateComposite() {
            return new PrompterCompositeForCookerStatus(serviceParent);
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices
         * 
         * @return a {@link PrompterCompositeForCookerStatus} object composed of all discoverable <code>Prompter</code>
         */
        public PrompterCompositeForCookerStatus all() {
            return instantiateComposite();
        }
        
        /**
         * Returns a proxy to one out of all accessible <code>Prompter</code> devices
         * 
         * @return a {@link PrompterProxyForCookerStatus} object pointing to a random discoverable <code>Prompter</code> device
         */
        public PrompterProxyForCookerStatus anyOne() {
            return all().anyOne();
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices whose attribute <code>id</code> matches a given value.
         * 
         * @param id The <code>id<code> attribute value to match.
         * @return a {@link PrompterCompositeForCookerStatus} object composed of all matching <code>Prompter</code> devices
         */
        public PrompterCompositeForCookerStatus whereId(java.lang.String id) throws CompositeException {
            return instantiateComposite().andId(id);
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices whose attribute <code>location</code> matches a given value.
         * 
         * @param location The <code>location<code> attribute value to match.
         * @return a {@link PrompterCompositeForCookerStatus} object composed of all matching <code>Prompter</code> devices
         */
        public PrompterCompositeForCookerStatus whereLocation(java.lang.String location) throws CompositeException {
            return instantiateComposite().andLocation(location);
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices whose attribute <code>user</code> matches a given value.
         * 
         * @param user The <code>user<code> attribute value to match.
         * @return a {@link PrompterCompositeForCookerStatus} object composed of all matching <code>Prompter</code> devices
         */
        public PrompterCompositeForCookerStatus whereUser(java.lang.String user) throws CompositeException {
            return instantiateComposite().andUser(user);
        }
    }
    
    /**
     * A composite of several <code>Prompter</code> devices to execute action on for the
     * <code>when provided CookerStatus</code> interaction contract.
    
    <pre>
    device Prompter extends PhysicalDevice {
    	action AskQuestion;
    	source answer as String indexed by questionId as String;
    }
    </pre>
     */
    protected final static class PrompterCompositeForCookerStatus extends fr.inria.diagen.core.service.composite.Composite<PrompterProxyForCookerStatus> {
        private PrompterCompositeForCookerStatus(Service serviceParent) {
            super(serviceParent, "/Device/Device/PhysicalDevice/Prompter/");
        }
        
        @Override
        protected PrompterProxyForCookerStatus instantiateProxy(RemoteServiceInfo rsi) {
            return new PrompterProxyForCookerStatus(service, rsi);
        }
        
        /**
         * Returns this composite in which a filter was set to the attribute <code>id</code>.
         * 
         * @param id The <code>id<code> attribute value to match.
         * @return this {@link PrompterCompositeForCookerStatus}, filtered using the attribute <code>id</code>.
         */
        public PrompterCompositeForCookerStatus andId(java.lang.String id) throws CompositeException {
            filterByAttribute("id", id);
            return this;
        }
        
        /**
         * Returns this composite in which a filter was set to the attribute <code>location</code>.
         * 
         * @param location The <code>location<code> attribute value to match.
         * @return this {@link PrompterCompositeForCookerStatus}, filtered using the attribute <code>location</code>.
         */
        public PrompterCompositeForCookerStatus andLocation(java.lang.String location) throws CompositeException {
            filterByAttribute("location", location);
            return this;
        }
        
        /**
         * Returns this composite in which a filter was set to the attribute <code>user</code>.
         * 
         * @param user The <code>user<code> attribute value to match.
         * @return this {@link PrompterCompositeForCookerStatus}, filtered using the attribute <code>user</code>.
         */
        public PrompterCompositeForCookerStatus andUser(java.lang.String user) throws CompositeException {
            filterByAttribute("user", user);
            return this;
        }
        
        /**
         * Executes the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         */
        public void askCloseQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerStatus proxy : proxies) {
                proxy.askCloseQuestion(to, questionId, title, content, possibleAnswers);
            }
        }
        
        /**
         * Executes the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         */
        public void askCloseQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers,
                java.lang.String image) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerStatus proxy : proxies) {
                proxy.askCloseQuestionWithImage(to, questionId, title, content, possibleAnswers, image);
            }
        }
        
        /**
         * Executes the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         */
        public void askOpenQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerStatus proxy : proxies) {
                proxy.askOpenQuestion(to, questionId, title, content);
            }
        }
        
        /**
         * Executes the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         */
        public void askOpenQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.lang.String image) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerStatus proxy : proxies) {
                proxy.askOpenQuestionWithImage(to, questionId, title, content, image);
            }
        }
    }
    
    /**
     * A proxy to one <code>Prompter</code> device to execute action on for the
     * <code>when provided CookerStatus</code> interaction contract.
    
    <pre>
    device Prompter extends PhysicalDevice {
    	action AskQuestion;
    	source answer as String indexed by questionId as String;
    }
    </pre>
     */
    protected final static class PrompterProxyForCookerStatus extends Proxy {
        private PrompterProxyForCookerStatus(Service service, RemoteServiceInfo remoteServiceInfo) {
            super(service, remoteServiceInfo);
        }
        
        /**
         * Executes the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         */
        public void askCloseQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers) throws InvocationException {
            callOrder("askCloseQuestion", to, questionId, title, content, possibleAnswers);
        }
        
        /**
         * Executes the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         */
        public void askCloseQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers,
                java.lang.String image) throws InvocationException {
            callOrder("askCloseQuestionWithImage", to, questionId, title, content, possibleAnswers, image);
        }
        
        /**
         * Executes the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         */
        public void askOpenQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content) throws InvocationException {
            callOrder("askOpenQuestion", to, questionId, title, content);
        }
        
        /**
         * Executes the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         */
        public void askOpenQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.lang.String image) throws InvocationException {
            callOrder("askOpenQuestionWithImage", to, questionId, title, content, image);
        }
        
        /**
         * @return the value of the <code>id</code> attribute
         */
        public java.lang.String id() {
            return (java.lang.String) callGetValue("id");
        }
        
        /**
         * @return the value of the <code>location</code> attribute
         */
        public java.lang.String location() {
            return (java.lang.String) callGetValue("location");
        }
        
        /**
         * @return the value of the <code>user</code> attribute
         */
        public java.lang.String user() {
            return (java.lang.String) callGetValue("user");
        }
    }
    // End of discover object for CookerStatus
    
    // Discover object for CookerProfile
    /**
     * An object to discover devices and contexts for the following interaction contract:
     * 
     * <code>
     * when provided CookerProfile do AskQuestion on Prompter;
     * </code>
     */
    protected final class DiscoverForCookerProfile {
        private final PrompterDiscovererForCookerProfile prompterDiscoverer = new PrompterDiscovererForCookerProfile(AbstractPrompterController.this);
        
        /**
         * @return a {@link PrompterDiscovererForCookerProfile} object to discover <code>Prompter</code> devices
         */
        public PrompterDiscovererForCookerProfile prompters() {
            return prompterDiscoverer;
        }
    }
    
    /**
     * Discover object that will exposes the <code>Prompter</code> devices to execute action on for the
     * <code>when provided CookerProfile</code> interaction contract.
    
    <pre>
    device Prompter extends PhysicalDevice {
    	action AskQuestion;
    	source answer as String indexed by questionId as String;
    }
    </pre>
     */
    protected final static class PrompterDiscovererForCookerProfile {
        private Service serviceParent;
        
        private PrompterDiscovererForCookerProfile(Service serviceParent) {
            super();
            this.serviceParent = serviceParent;
        }
        
        private PrompterCompositeForCookerProfile instantiateComposite() {
            return new PrompterCompositeForCookerProfile(serviceParent);
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices
         * 
         * @return a {@link PrompterCompositeForCookerProfile} object composed of all discoverable <code>Prompter</code>
         */
        public PrompterCompositeForCookerProfile all() {
            return instantiateComposite();
        }
        
        /**
         * Returns a proxy to one out of all accessible <code>Prompter</code> devices
         * 
         * @return a {@link PrompterProxyForCookerProfile} object pointing to a random discoverable <code>Prompter</code> device
         */
        public PrompterProxyForCookerProfile anyOne() {
            return all().anyOne();
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices whose attribute <code>id</code> matches a given value.
         * 
         * @param id The <code>id<code> attribute value to match.
         * @return a {@link PrompterCompositeForCookerProfile} object composed of all matching <code>Prompter</code> devices
         */
        public PrompterCompositeForCookerProfile whereId(java.lang.String id) throws CompositeException {
            return instantiateComposite().andId(id);
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices whose attribute <code>location</code> matches a given value.
         * 
         * @param location The <code>location<code> attribute value to match.
         * @return a {@link PrompterCompositeForCookerProfile} object composed of all matching <code>Prompter</code> devices
         */
        public PrompterCompositeForCookerProfile whereLocation(java.lang.String location) throws CompositeException {
            return instantiateComposite().andLocation(location);
        }
        
        /**
         * Returns a composite of all accessible <code>Prompter</code> devices whose attribute <code>user</code> matches a given value.
         * 
         * @param user The <code>user<code> attribute value to match.
         * @return a {@link PrompterCompositeForCookerProfile} object composed of all matching <code>Prompter</code> devices
         */
        public PrompterCompositeForCookerProfile whereUser(java.lang.String user) throws CompositeException {
            return instantiateComposite().andUser(user);
        }
    }
    
    /**
     * A composite of several <code>Prompter</code> devices to execute action on for the
     * <code>when provided CookerProfile</code> interaction contract.
    
    <pre>
    device Prompter extends PhysicalDevice {
    	action AskQuestion;
    	source answer as String indexed by questionId as String;
    }
    </pre>
     */
    protected final static class PrompterCompositeForCookerProfile extends fr.inria.diagen.core.service.composite.Composite<PrompterProxyForCookerProfile> {
        private PrompterCompositeForCookerProfile(Service serviceParent) {
            super(serviceParent, "/Device/Device/PhysicalDevice/Prompter/");
        }
        
        @Override
        protected PrompterProxyForCookerProfile instantiateProxy(RemoteServiceInfo rsi) {
            return new PrompterProxyForCookerProfile(service, rsi);
        }
        
        /**
         * Returns this composite in which a filter was set to the attribute <code>id</code>.
         * 
         * @param id The <code>id<code> attribute value to match.
         * @return this {@link PrompterCompositeForCookerProfile}, filtered using the attribute <code>id</code>.
         */
        public PrompterCompositeForCookerProfile andId(java.lang.String id) throws CompositeException {
            filterByAttribute("id", id);
            return this;
        }
        
        /**
         * Returns this composite in which a filter was set to the attribute <code>location</code>.
         * 
         * @param location The <code>location<code> attribute value to match.
         * @return this {@link PrompterCompositeForCookerProfile}, filtered using the attribute <code>location</code>.
         */
        public PrompterCompositeForCookerProfile andLocation(java.lang.String location) throws CompositeException {
            filterByAttribute("location", location);
            return this;
        }
        
        /**
         * Returns this composite in which a filter was set to the attribute <code>user</code>.
         * 
         * @param user The <code>user<code> attribute value to match.
         * @return this {@link PrompterCompositeForCookerProfile}, filtered using the attribute <code>user</code>.
         */
        public PrompterCompositeForCookerProfile andUser(java.lang.String user) throws CompositeException {
            filterByAttribute("user", user);
            return this;
        }
        
        /**
         * Executes the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         */
        public void askCloseQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerProfile proxy : proxies) {
                proxy.askCloseQuestion(to, questionId, title, content, possibleAnswers);
            }
        }
        
        /**
         * Executes the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         */
        public void askCloseQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers,
                java.lang.String image) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerProfile proxy : proxies) {
                proxy.askCloseQuestionWithImage(to, questionId, title, content, possibleAnswers, image);
            }
        }
        
        /**
         * Executes the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         */
        public void askOpenQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerProfile proxy : proxies) {
                proxy.askOpenQuestion(to, questionId, title, content);
            }
        }
        
        /**
         * Executes the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> action's method on all devices of this composite.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         */
        public void askOpenQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.lang.String image) throws InvocationException {
            launchDiscovering();
            for (PrompterProxyForCookerProfile proxy : proxies) {
                proxy.askOpenQuestionWithImage(to, questionId, title, content, image);
            }
        }
    }
    
    /**
     * A proxy to one <code>Prompter</code> device to execute action on for the
     * <code>when provided CookerProfile</code> interaction contract.
    
    <pre>
    device Prompter extends PhysicalDevice {
    	action AskQuestion;
    	source answer as String indexed by questionId as String;
    }
    </pre>
     */
    protected final static class PrompterProxyForCookerProfile extends Proxy {
        private PrompterProxyForCookerProfile(Service service, RemoteServiceInfo remoteServiceInfo) {
            super(service, remoteServiceInfo);
        }
        
        /**
         * Executes the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestion(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[])</code> method.
         */
        public void askCloseQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers) throws InvocationException {
            callOrder("askCloseQuestion", to, questionId, title, content, possibleAnswers);
        }
        
        /**
         * Executes the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param possibleAnswers the <code>possibleAnswers</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askCloseQuestionWithImage(to as Contact, questionId as String, title as String, content as String, possibleAnswers as String[], image as String)</code> method.
         */
        public void askCloseQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.util.List<java.lang.String> possibleAnswers,
                java.lang.String image) throws InvocationException {
            callOrder("askCloseQuestionWithImage", to, questionId, title, content, possibleAnswers, image);
        }
        
        /**
         * Executes the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestion(to as Contact, questionId as String, title as String, content as String)</code> method.
         */
        public void askOpenQuestion(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content) throws InvocationException {
            callOrder("askOpenQuestion", to, questionId, title, content);
        }
        
        /**
         * Executes the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> action's method on this device.
         * 
         * @param to the <code>to</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param questionId the <code>questionId</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param title the <code>title</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param content the <code>content</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         * @param image the <code>image</code> parameter of the <code>askOpenQuestionWithImage(to as Contact, questionId as String, title as String, content as String, image as String)</code> method.
         */
        public void askOpenQuestionWithImage(fr.inria.phoenix.diasuite.framework.datatype.contact.Contact to,
                java.lang.String questionId,
                java.lang.String title,
                java.lang.String content,
                java.lang.String image) throws InvocationException {
            callOrder("askOpenQuestionWithImage", to, questionId, title, content, image);
        }
        
        /**
         * @return the value of the <code>id</code> attribute
         */
        public java.lang.String id() {
            return (java.lang.String) callGetValue("id");
        }
        
        /**
         * @return the value of the <code>location</code> attribute
         */
        public java.lang.String location() {
            return (java.lang.String) callGetValue("location");
        }
        
        /**
         * @return the value of the <code>user</code> attribute
         */
        public java.lang.String user() {
            return (java.lang.String) callGetValue("user");
        }
    }
    // End of discover object for CookerProfile
}
